package net.homelinux.chaoswg.io.renga.core.gui.operations.reader;

import net.homelinux.chaoswg.io.higherorderfunctions.AbstractUnaryFunction;
import net.homelinux.chaoswg.io.higherorderfunctions.UnaryFunction;
import net.homelinux.chaoswg.io.renga.core.gui.operations.FunctionOutputOperation;
import net.homelinux.chaoswg.io.renga.core.gui.operations.Operation;

import org.jdom.Element;

public class FunctionOutputOperationReader extends AbstractUnaryFunction<Operation, Element> implements UnaryFunction<Operation, Element>, OperationReader {

    public Operation apply(final Element arg0) throws IllegalArgumentException {
        final FunctionOutputOperation foo = new FunctionOutputOperation();
        
        foo.setIsOutputNumber(Integer.parseInt(arg0.getChildText("outputNumber")));

        final CommonOperationReader cor = new CommonOperationReader ();
        cor.apply(foo, arg0);
        
        return foo;
    }
}

